// pages/person/coinex/index.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    headTop: "",
    headHeight: "",
    sumHeight: "",
    screenHeight: "",
    cell: [],
    money:0
  },
  onLoad(options) {
    const that = this;
    app.http.post(app.api.balance,{},(res)=>{
      if (res.data == "") {
        that.setData({
          cell: res.data,
          isCell: true,
          money:options.money
        })
      } else {
        that.setData({
          cell: res.data,
          isCell: false,
          money:options.money
        })
      }
    })
      that.setData({
      headTop: app.globalData.headTop,
      headHeight: app.globalData.headHeight,
      sumHeight: app.globalData.sumHeight,
    });
  },
  onShow() {
    const that = this;
    const query = wx.createSelectorQuery();
    query.select(".cards").boundingClientRect();
    query.exec((res) => {
      console.log(res);
      let screenHeight =
        (app.globalData.screenHeight - res[0].top - 65) * 2 + "rpx";
      console.log(app.globalData.screenHeight, res.top, screenHeight);
      that.setData({
        screenHeight,
      });
    });
  },
  back() {
    wx.navigateBack({
      delta: 1,
    });
  },
});
